package com.xmmxjy.upload;

import me.desair.tus.server.TusFileUploadService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication(scanBasePackages = "com.xmmxjy")
public class UploadApplication {

    public static void main(String[] args) {
        SpringApplication.run(UploadApplication.class, args);
    }

    @Bean
    public TusFileUploadService tusFileUploadService(AppProperties appProperties) {
        return new TusFileUploadService().withStoragePath(appProperties.getTusUploadDirectory())
                .withUploadURI("/upload");
    }

}
